package com.haolijun.eecms.controller.form;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @ClassName InsertFacilityForm
 * @Description TODO
 * @Author hljstart
 * @Date 2023/3/12 15:18
 * @Version 1.0
 */
@Data
public class InsertFacilityForm {

    @NotBlank(message = "name不能为空")
    @Schema(description = "设备名字")
    private String name;

    @NotNull(message = "price不能为空")
    @Schema(description = "设备价格")
    private Double price;

    @NotBlank(message = "image不能为空")
    @Schema(description = "设备图片地址")
    private String image;


    @NotBlank(message = "type不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9\\u4e00-\\u9fa5]{1,3}$",message = "违纪类型格式错误")
    @Schema(description = "设备类型")
    private String type;

    @NotNull(message = "amount不能为空")
    @Range(min = 1, max = 99999,message = "amount必须在1~99999之间")
    private Integer amount;
}
